Ext.ns('Tm.chart');
Tm.chart.ChartIndexPanel = Ext.extend(Ext.Panel, {
			frame : true,
			autoWidth : true,
			// autoHeight : true,
			layout : 'fit',
			html : '<div id="line_chart">line_chart</div><div id="bar_chart">bar_chart</div><div id="pie_chart">pie_chart</div>',
			initComponent : function() {
				Tm.chart.ChartIndexPanel.superclass.initComponent.call(this);
			},
			listeners : {
				afterrender : function() {
					Ext.Ajax.request({
								url : 'chart/getLineChartData.do',
								params : {
					// id : dataId
								},
								success : function(response, action) {
									var data = Ext.decode(response.responseText);
									// var myData = new Array([10, 20], [15, 10], [20, 30], [25, 10], [30, 5]);
									var myChart = new JSChart('line_chart', 'line');
									myChart.setDataArray(data);
									myChart.draw();
								},
								failure : function(response, action) {
									App.setAlert('error', '载入失败');
								}
							});
					Ext.Ajax.request({
								url : 'chart/getBarChartData.do',
								params : {
					// id : dataId
								},
								success : function(response, action) {
									var data = Ext.decode(response.responseText);
									var myChart = new JSChart('bar_chart', 'bar');
									myChart.setDataArray(data);
									myChart.draw();
								},
								failure : function(response, action) {
									App.setAlert('error', '载入失败');
								}
							});
					Ext.Ajax.request({
								url : 'chart/getPieChartData.do',
								params : {
					// id : dataId
								},
								success : function(response, action) {
									var data = Ext.decode(response.responseText);
									var myChart = new JSChart('pie_chart', 'pie');
									myChart.setDataArray(data);
									myChart.draw();
									

									
								},
								failure : function(response, action) {
									App.setAlert('error', '载入失败');
								}
							});
				}
			}
		});
